<template>
	<view>
		<view style="background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230411/e63bcf73858e37c567847ca55821ddfa.png) no-repeat;background-size: 100%;width: 100%;height: 414rpx;">

		</view>
		<view style="width: 92%;position: absolute;top:10rpx;left: 4%;padding-bottom: 30rpx;">
			<view v-if="list3.length>0" style="margin-bottom: 30rpx;">
				<u-swiper
							:list="list3"
							height="160"
							radius="10"
							indicator
							indicatorMode="line"
							circular
					></u-swiper>
			</view>
			<view v-if="false" style="width: 690rpx;max-height: 460rpx;background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%20567%402x.png) no-repeat;background-size: 100%;margin-bottom: 26rpx;box-sizing: border-box;padding: 30rpx;position: relative;">
				<view style="overflow: hidden;">
					<view style="width: 23%;float: left;">
						<image :src="xq.logo_image" style="width: 116rpx;height: 116rpx;display: block;" mode=""></image>
					</view>
					<view style="width: 77%;float: left;">
						<view style="line-height: 40rpx;color: #000000;font-size: 36rpx;font-weight: 600;margin-top: 10rpx;" class="erhang">
							{{xq.name || ''}}
						</view>
						<view v-if="xq.special_manage==3" style="color: #999999;font-size: 22rpx;margin-top: 20rpx;line-height: 30rpx;" class="erhang">
							生产品类：{{xq.process_text || ''}}
						</view>
						<view v-if="xq.special_manage==2" style="color: #999999;font-size: 22rpx;margin-top: 20rpx;line-height: 30rpx;" class="erhang">
							物流业务：{{xq.wl_main_text || ''}}
						</view>
					</view>
					<!-- <view style="width: 15%;float: left;text-align: right;padding-top: 10rpx;">
						<text style="background: linear-gradient(0deg, #C18C26 0%, #E1AC4E 100%);color: #FFFFFF;font-size: 22rpx;padding: 2rpx 10rpx;">
							认证
						</text>
					</view> -->
				</view>
				<view style="line-height: 40rpx;color: #999999;font-size: 24rpx;margin-top: 30rpx;width: 85%;">
					<text class="iconfont icon-dizhi1" style="color: #999999;font-size: 26rpx;"></text>
					{{xq.address}}
				</view>
				<text class="iconfont icon-zhuanfa" style="position: absolute;top: 50%;right: 30rpx;transform: translateY(-50%);font-size: 40rpx;"></text>
				<button open-type="share" style="position: absolute;top: 50%;right: 30rpx;transform: translateY(-50%);opacity: 0;width: 20rpx;height: 20rpx;" type="default"></button>
				<view style="width: 92%;margin: 0 auto;">
					<view style="display: flex;margin-top: 60rpx;color: #999999;font-size: 22rpx;justify-content: space-between;">
						<view >
							浏览量:{{xq.views_num}}
						</view>
						<view >
							关注数：{{xq.attention_num}}人
						</view>
						<view >
							联系次数：{{xq.contact_num || 0}}次
						</view>
					</view>
					<view style="margin: 30rpx 0;overflow: hidden;">
						<image v-for="(item,index) in xq.views_user" :key='index' :src="item" class="tou" mode=""></image>
						<text style="color: #666666;font-size: 24rpx;line-height: 54rpx;float: right;">{{xq.views_num}}人看过</text>
					</view>
				</view>
			</view>
			<companyDetail :item="xq" @openReport="openReport"></companyDetail>
			<view style="display: flex;line-height: 80rpx;text-align: center;">

				<view style="flex: 1;position: relative;" @click="qi_huo(2)" :class="qh_type==2?'qiactive_type':'qi_type'">
					企业介绍
				</view>
				<view style="flex: 1;position: relative;" @click="qi_huo(1)" :class="qh_type==1?'qiactive_type':'qi_type'">
					最新动态
				</view>
				<view style="flex: 1;position: relative;" @click="qi_huo(3)" :class="qh_type==3?'qiactive_type':'qi_type'">
					留言互动
				</view>
			</view>
			<view v-if="qh_type==1" style="padding-bottom: 150rpx;">
				<view v-if="list.length>0"  v-for="(item,index) in list" :key='index' style="box-sizing: border-box;padding: 30rpx;background-color: #FFFFFF;margin-top: 26rpx;border-radius: 12rpx;">
					<view style="overflow: hidden;">
						<view @click="yonghu_xx(item.user_id)" style="width: 18%;float: left;overflow: hidden;">
							<image :src="item.user.avatar" style="width: 92rpx;height: 92rpx;border-radius: 50%;display: block;" mode=""></image>
						</view>
						<view @click="tzxq(item.id)" style="width: 82%;float: left;padding: 6rpx 0;">
							<view style="height: 40rpx;line-height: 40rpx;">
								<text style="color: #000000;font-size: 30rpx;display: inline-block;width: 200rpx;font-weight: 600;" class="yihang">{{item.user.nickname}}</text>
								<text style="color: #999999;font-size: 24rpx;float: right;">发布于 {{item.create_time}}</text>
							</view>
							<view style="height: 40rpx;line-height: 40rpx;color: #999999;font-size: 24rpx;" class="yihang">
								{{item.user.company || ''}}
							</view>
						</view>
					</view>
					<!-- <view style="line-height: 60rpx;color: #000000;font-size: 30rpx;margin-top: 10rpx;font-weight: 600;">
						新鲜冻虾
					</view> -->
					<view style="color: #666666;font-size: 28rpx;line-height: 40rpx;margin-top: 20rpx;" class="erhang">
						{{item.main_content}}
					</view>
					<view style="overflow: hidden;margin-top: 20rpx;" class="tu" v-if="item.main_images">
						<view v-for="(a,b) in item.main_images" :key='b' style="width: 190rpx;height: 190rpx;float: left;border-radius: 16rpx;overflow: hidden;">
							<image :src="a" style="width: 100%;height: 100%;left: 0;" mode="aspectFill"></image>
						</view>

					</view>
					<view style="line-height: 80rpx;display: flex;">
						<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
							<image src="@/static/index/icon_collect.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
							收藏({{item.collect_num}})

						</view>
						<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
							<image src="@/static/index/icon_comment.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
							评论({{item.comment_num}})

						</view>
						<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
							<image src="@/static/index/icon_like.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
							点赞({{item.like_num}})

						</view>
					</view>
				</view>
				<view style="text-align: center;">
					<image v-if="kk" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据"
						v-if="list.length==0"></u-divider>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了"
						v-if="list.length>0 && enmpy"></u-divider>
				</view>
			</view>
			<view v-if="qh_type==2" style="padding-bottom: 150rpx;">
				<view v-if="xq.main_content" style="width: 100%;box-sizing: border-box;padding: 30rpx 20rpx;border-radius: 16rpx;margin-top: 30rpx;">
					<view v-html="xq.main_content" style="color: #010101;font-size: 24rpx;line-height: 50rpx;">

					</view>
				</view>
				<view v-if="xq.special_manage==2">
					<view style="overflow: hidden;line-height: 40rpx;margin: 10rpx 0;font-size: 26rpx;">
						车长：<text style="margin-right: 10rpx;" v-for="(item,index) in xq.logistics.vehicle_length_arr" :key='index'>{{item.title}}</text>
					</view>
					<view style="overflow: hidden;line-height: 40rpx;margin: 10rpx 0;font-size: 26rpx;">
						车辆类型：<text style="margin-right: 10rpx;" v-for="(item,index) in xq.logistics.car_type_arr" :key='index'>{{item.title}}</text>
					</view>
					<view style="overflow: hidden;line-height: 40rpx;margin: 10rpx 0;font-size: 26rpx;">
						服务类型：<text style="margin-right: 10rpx;" v-for="(item,index) in xq.logistics.service_type_arr" :key='index'>{{item.title}}</text>
					</view>
					<view style="overflow: hidden;line-height: 40rpx;margin: 10rpx 0;font-size: 26rpx;">
						出发地：<text style="margin-right: 10rpx;" v-for="(item,index) in xq.logistics.destination_address_arr" :key='index'>{{item.name}}</text>
					</view>
					<view style="overflow: hidden;line-height: 40rpx;margin: 10rpx 0;font-size: 26rpx;">
						目的地：<text style="margin-right: 10rpx;" v-for="(item,index) in xq.logistics.place_address_arr" :key='index'>{{item.name}}</text>
					</view>
				</view>
				<view v-if="xq.special_manage==3">
					<view style="overflow: hidden;line-height: 40rpx;margin: 10rpx 0;font-size: 26rpx;">
						生产品类：
						<!-- <view v-if="xq.process_text.split(',').length>0" style="overflow: hidden;margin: 20rpx 0;" >
							<view v-for="(item,index) in xq.process_text.split(',')" :key='index' style="float: left;line-height: 60rpx;height: 60rpx;padding: 0 30rpx;margin: 10rpx;font-size: 26rpx;color: #333333;background-color: #F3F3F3;border-radius: 30rpx;display: inline-block;">
								{{item}}
							</view>
						</view> -->
						<view v-if="xq.process_text" style="width: 100%;box-sizing: border-box;padding: 10rpx 20rpx;border-radius: 16rpx;">
							<view style="color: #010101;font-size: 26rpx;line-height: 50rpx;">
								{{xq.process_text || ''}}
							</view>
						</view>
					</view>
				</view>
			</view>
			<view v-if="qh_type==3" style="padding-bottom: 150rpx;">
				<view v-if="list.length>0" style="width: 100%;margin-top: 30rpx;background-color: #FFFFFF;box-sizing: border-box;padding: 30rpx;border-radius: 16rpx;">
					<view  v-for="(item,index) in list" :key='index' style="padding-bottom: 20rpx;border-bottom: 1px solid #eeeeee;">
						<view style="width: 92%;overflow: hidden;margin: 20rpx auto;">
							<image :src="item.client.avatar" style="width: 64rpx;height: 64rpx;display: block;float: left;border-radius: 50%;margin-top: 8rpx;" mode=""></image>
							<view style="margin-left: 20rpx;float: left;">
								<view style="line-height: 40rpx;color: #191919;font-size: 26rpx;">
									{{item.client.nickname}}
								</view>
								<view style="line-height: 40rpx;color: #999999;font-size: 24rpx;">
									{{item.create_time}}
								</view>
							</view>
						</view>
						<view style="width: 92%;margin: 0 auto;color: #191919;font-size: 24rpx;line-height: 50rpx;">
							{{item.comment || ''}}
						</view>
						<!-- <view style="width: 92%;margin: 0 auto;color: #999999;font-size: 24rpx;line-height: 40rpx;">
							浏览{{item.pv}}次
						</view> -->
						<view v-if='item.reply' style="width: 92%;margin: 10rpx auto 30rpx;box-sizing: border-box;padding: 30rpx;border-radius: 10rpx;background-color:#F7F7F7 ;font-size: 26rpx;line-height: 50rpx;word-break:break-all;word-wrap:break-word;">
							<text style="color: #336699;">{{item.firm.name}}：</text>
							<text style="color: #333333;">{{item.reply}}</text>
						</view>
					</view>
				</view>
				<view style="text-align: center;">
					<image v-if="kk" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据"
						v-if="list.length==0"></u-divider>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了"
						v-if="list.length>0 && enmpy"></u-divider>
				</view>
			</view>
			<view style="position: fixed;left: 0;bottom: 0;width: 100%;background-color: #FFFFFF;">
				<view style="width: 100%;box-sizing: border-box;padding: 30rpx 30rpx 50rpx;display: flex;">
					<view @click="lianxi" style="flex: 2;">
						<view style="width:100%;height: 60rpx;line-height: 60rpx;border-radius: 30rpx;text-align: center;background-color: #1fb0ac;color: #FFFFFF;font-size: 24rpx;text-align: center;">
							企业通讯录
						</view>
					</view>
					<!-- <view @click="lahei" style="flex: 2;color: #000000;font-size: 26rpx;line-height: 60rpx;font-weight: 600;margin-left: 20rpx;">
						<text>拉黑该企业</text>
					</view> -->
					<view @click="gz_cj" style="flex: 1;color: #000000;font-size: 26rpx;line-height: 60rpx;font-weight: 600;">
						<image v-if="xq.is_attention==2" src="@/static/index/icon_collect.png" style="width: 40rpx;height: 40rpx;float: left;margin: 10rpx 10rpx 10rpx 30rpx;" mode=""></image>
						<image v-if="xq.is_attention==1" src="@/static/index/icon_collect1.png" style="width: 40rpx;height: 40rpx;float: left;margin: 10rpx 20rpx;" mode=""></image>
						<text v-if="xq.is_attention==1" style="color: #F0AD4E;">已关注企业</text>
						<text v-if="xq.is_attention==2">关注该企业</text>
					</view>
				</view>
			</view>
		</view>
		<image v-if="qh_type==3" @click="liu" src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/liu.png" style="width: 80rpx;height: 80rpx;position: fixed;right: 0;bottom: 400rpx;" mode=""></image>
		<uni-popup id="popup" ref="popup5" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 600rpx;">
				<textarea   v-model="nei" placeholder="请输入您的留言" style="padding:20rpx;font-size: 24rpx;line-height: 40rpx;height: 200rpx;" />
				<view class="footer">
					<button @click="quxiao5" style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
					 type="default">取消</button>
					<button @click="huifu" lang="zh_CN" style="flex: 1;background-color: #1fb0ac;color: #FFFFFF;" open-type="getUserInfo">留言</button>
					<!-- <button @click="submitLink" type="default" class="submit">确认提交</button> -->
				</view>
			</view>
		</uni-popup>
		<uni-popup
      class="login-popup"
      mode="center"
      id="popupReport"
      mask-background-color="rgba(0,0,0,0.9)"
      ref="popupReport"
      :type="type_status"
      :animation="true"
    >
      <view class="login_container relative" style="background-color: #FFFFFF;padding:50rpx 44rpx 30rpx;border-radius: 20rpx;">
        <view
          class=""
          style="background-color: #FFFFFF;border-radius: 20rpx;">
          <view style="line-height: 80upx;color: #333333;font-size: 30upx;height: 80rpx;">
            内容描述
          </view>
          <view class="textarea_item">
            <textarea  maxlength="540" placeholder="请输入内容描述(最多540字符)" v-model="reportContent"
            style="width: auto;height: 300rpx;line-height: 40rpx;font-size: 26rpx;" />
          </view>
          <view class="upload">
            <view class="uploadimgcont">
              <view class="uploadimga" v-for="(item,index) in addImgArray_arr" :key="index">
                <view class="delete" @click="imgdelete(index)">
                  <view class="deleteline">
                  </view>
                </view>
                <image @click="fangda(index)" :src="item" mode="aspectFill"></image>
              </view>
              <view  v-if="!addImgArray_arr || addImgArray_arr.length<9" class="uploadimg" @click="chooseImage">
                <image
                  src="@/static/msg/add-photo.png"
                  style="border-radius: 12rpx;" mode=""></image>
              </view>
            </view>
          </view>
        </view>
        <view class="footer1 flex" style="display: flex;align-items: center;justify-content: center;margin-top: 60rpx;">
          <u-button
            style="width: 240rpx;height: 80rpx;
                line-height: 80rpx;
                color: #666;
                border-radius: 80rpx;
                border: 1px solid #d9d9d9;
                background-color: #d9d9d9;
                margin-right: 30rpx;"
            text="取消"
            @click="cancelPopupReport"
            shape="circle"
          ></u-button>
          <u-button
            @click="submitReport"
            style="width: 240rpx;
              height: 80rpx;
              line-height: 80rpx;"
            text="确定"
            shape="circle"
            color="linear-gradient(to right, #1CD19F, #1FB0AC)"
          ></u-button>
        </view>
      </view>
    </uni-popup>
    <uploadImg :singleNum="false" ref="uploadImg" v-model="addImgArray_arr" permissionCameraContent="获取拍照权限是为了能够上传图片" permissionAlbumContent="获取相册权限，是为了能够上传图片" />
    <noLoginToast ref="noLoginToast" />
	</view>
</template>

<script>
import {
		validateNull
	} from '@/common'
	export default{
		data(){
			return{
				type_status: 'top',
				isChecked: false,
				isLogin: 'login',
				reportId: '',
				reportContent: '',
				addImgArray_arr: [],
				reportParams: {},
				list3: [],
				qh_type:2,
				id:'',
				xq:{},
				page:1,
				list:[],
				kk:false,
				enmpy:false,
				type:'center',
				nei:''
			}
		},
		// onReachBottom: function() {
		// 	if(this.qh_type==1){
		// 		if (this.enmpy) {
		// 			return
		// 		} else {
		// 			this.gengxin()
		// 		}
		// 	}else if(this.qh_type==3){
		// 		if (this.enmpy) {
		// 			return
		// 		} else {
		// 			this.liuyan()
		// 		}
		// 	}

		// },
		onLoad(option) {
			this.id=option.id
			uni.setNavigationBarTitle({
				title:option.name
			})
			// this.gengxin()
			this.qyxq()
		},
		methods:{
			async openReport() {
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				this.$refs.popupReport.open()
			},
			submitReport() {
				if (validateNull(this.reportContent)) {
					return uni.showToast({
						title: '内容不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				if (validateNull(this.addImgArray_arr)) {
					return uni.showToast({
						title: '图片不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				// /api/client/complaint     POST
				// uid=投诉对象id，必传
				// msg=消息，必传
				// img=图片，非必传
				let params = {
					msg: this.reportContent,
					img: this.addImgArray_arr.join(','),
					uid: this.xq.client_id
				}
				console.log('%c [ params ]-144', 'font-size:13px; background:pink; color:#bf2c9f;', params)
				// return
				this.post('api/client/complaint',params,true).then(res=>{
					if(res.code==1){
						uni.showToast({
							title: '举报成功',
							icon: "none",
							duration: 1000
						})
						this.closePopupReport()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			cancelPopupReport() {
				this.closePopupReport()
			},
			closePopupReport() {
				this.$refs.popupReport.close()
			},
			// 上传图片
			async chooseImage() {
				// let isLogin = await this.$refs.noLoginToast.open()
				// if (!isLogin) {
				// 	return
				// }
				// let stutas = await requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
				// openAppSettingPermissions()
				// console.log('%c [ stutas ]-862', 'font-size:13px; background:pink; color:#bf2c9f;', stutas)
				let that = this
				if (that.addImgArray_arr.length >= 9) {
					uni.showToast({
						icon: 'none',
						title: '最多上传9张图片'
					})
					return
				}
				try {
					this.$refs.uploadImg.open()
				} catch (error) {
					uni.hideLoading()
				}
			},
			// 删除图片
			imgdelete(index) {
				// this.addimgArray.splice(index, 1)
				this.addImgArray_arr.splice(index, 1)
				// this.addimgArray.splice(index, 1)
			},
			submitReport() {
				if (validateNull(this.reportContent)) {
					return uni.showToast({
						title: '内容不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				if (validateNull(this.addImgArray_arr)) {
					return uni.showToast({
						title: '图片不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				// /api/client/complaint     POST
				// uid=投诉对象id，必传
				// msg=消息，必传
				// img=图片，非必传
				let params = {
					msg: this.reportContent,
					img: this.addImgArray_arr.join(','),
					uid: this.xq.client_id
				}
				console.log('%c [ params ]-144', 'font-size:13px; background:pink; color:#bf2c9f;', params)
				// return
				this.post('api/client/complaint',params,true).then(res=>{
					if(res.code==1){
						uni.showToast({
							title: '举报成功',
							icon: "none",
							duration: 1000
						})
						this.closePopupReport()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			cancelPopupReport() {
				this.closePopupReport()
			},
			closePopupReport() {
				this.$refs.popupReport.close()
			},
			// 上传图片
			async chooseImage() {
				// let isLogin = await this.$refs.noLoginToast.open()
				// if (!isLogin) {
				// 	return
				// }
				// let stutas = await requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
				// openAppSettingPermissions()
				// console.log('%c [ stutas ]-862', 'font-size:13px; background:pink; color:#bf2c9f;', stutas)
				let that = this
				if (that.addImgArray_arr.length >= 9) {
					uni.showToast({
						icon: 'none',
						title: '最多上传9张图片'
					})
					return
				}
				try {
					this.$refs.uploadImg.open()
				} catch (error) {
					uni.hideLoading()
				}
			},
			// 删除图片
			imgdelete(index) {
				// this.addimgArray.splice(index, 1)
				this.addImgArray_arr.splice(index, 1)
				// this.addimgArray.splice(index, 1)
			},
			// 用户信息
			yonghu_xx(id){
				uni.navigateTo({
					url:'../wenzhang/yhxx?id='+id
				})
			},
			// 帖子详情
			tzxq(id){
				uni.navigateTo({
					url:'wzxq?id='+id
				})
			},
			qi_huo(index){
				this.qh_type=index
				if(index==1){
					this.kk=false
					this.list=[]
					this.enmpy=false
					this.page=1
					this.gengxin()
				}else if(index==3){
					this.kk=false
					this.list=[]
					this.enmpy=false
					this.page=1
					this.liuyan()
				}
			},

			// 最新动态
			gengxin(){
				this.post('api/firm_data/voice',{firm_id:this.id,page:this.page,limit:10},true).then(res=>{
					console.log(res)
					if(res.code==1){
						if(this.page==1){
							if (res.data.data== null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}else{
							if (res.data.data== null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					}else{
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			// 留言互动
			async liuyan(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.post('api/firm_data/message_list',{firm_id:this.id,page:this.page,limit:10},true).then(res=>{
					console.log(res)
					if(res.code==1){
						if(this.page==1){
							if (res.data.data== null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}else{
							if (res.data.data== null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					}else{
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			async liu(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.$refs.popup5.open()
			},
			quxiao5(){
				this.$refs.popup5.close()
			},
			async huifu(){
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					console.log('%c [ isHasMobile ]-452', 'font-size:13px; background:pink; color:#bf2c9f;', isHasMobile)
					if (!isHasMobile) {
						return
					}
				}
				this.post('api/firm_data/message',{firm_id:this.id,comment:this.nei},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						this.$refs.popup5.close()
						this.nei=''
						this.page= 1
						this.kk=false
						this.enmpy= false
						this.list=[]
						this.liuyan()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},



			// 联系企业
			lianxi(){
				uni.navigateTo({
					url:'/fenbao/pages/wenzhang/lxqy?id='+this.id
				})
			},


			// 企业详情
			qyxq(){
				this.post('api/firm_data/info',{id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.xq=res.data
						this.list3=res.data.main_images
					}
				})
			},
			// 关注企业
			async gz_cj(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.post('api/firm_data/attention',{firm_id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						if(res.data){
							this.xq.is_attention=1
						}else{
							this.xq.is_attention=2
						}
					}
				})
			},
			// 拉黑企业
			lahei(){
				this.post('api/client/black_firm',{firm_id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						setTimeout(function(){
							uni.switchTab({
								url:'/pages/index/index'
							})
						},1500)
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #F8F8F8!important;
		padding-bottom: 150rpx;
		font-family: Demibold;
	}
	.tu>view {
		margin: 10rpx 0;
	}

	.tu>view:nth-child(3n+2) {
		margin: 10rpx 30rpx;
	}
	.fenlei{
		width: 100%;
		margin-top: 26rpx;
		height: 350rpx;
		background: url(https://dyeego.oss-cn-beijing.aliyuncs.com/uploads/20220325/dbfaf5dddb188c6274941398431f8080.png) no-repeat;
		background-size: 100%;
		box-sizing: border-box;
		padding: 50rpx 0;
	}
	.tui_mei{
		color: #666666;
		font-size: 28rpx;
		font-weight: 500;
	}
	.tui_active{
		color: #000000;
		font-size: 28rpx;
		font-weight: 600;
	}
	.tou{
		width: 54rpx;
		height: 54rpx;
		float: left;
		border-radius: 50%;
		margin-left: -20rpx;
	}
	.tou:first-child{
		margin-left: 0;
	}

	.qi_type{
		color: #999999;
		font-size: 30rpx;
		font-weight: 500;
	}
	.qiactive_type{
		color: #000000;
		font-size: 30rpx;
		font-weight: 600;
	}
	.qiactive_type::after {
	     content: ''; // 必须
	     position: absolute;
	     left: 50%;
	     bottom: 0rpx;
		 transform: translateX(-50%);
	     width: 60rpx;
	     height: 6rpx;
	     background-color: #0078FF;
	}
	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;
		}
	}
			// 上传图片
.upload {
		// background: #FFFFFF;
		// padding: 0 40rpx;
		// height: 100vh;
		// height: 700upx;

		.title {
			font-size: 30rpx;
			font-weight: bold;
			color: #343434;
			padding-top: 15rpx;
		}

		.uploadimgcont {
			display: flex;
			// justify-content: space-between;
			flex-wrap: wrap;
			// margin-top: 50rpx;
			// margin:30upx 0 136upx;

			.uploadimga {
				width: 186rpx;
				height: 186rpx;
				margin-right: 24upx;
				margin-bottom: 40upx;
				position: relative;

				.delete {
					width: 40rpx;
					height: 40rpx;
					border-radius: 50%;
					background: #5093ff;
					display: flex;
					align-items: center;
					justify-content: space-around;
					position: absolute;
					top: -10upx;
					left: -10upx;
					z-index: 4;

					.deleteline {
						background: #FFFFFF;
						height: 5rpx;
						width: 50%;
					}
				}

				image {
					width: 100%;
					height: 100%;
				}
			}

			.uploadimg {
				width: 120rpx;
				height: 120rpx;
				background: #F9F9F9;
				border-radius: 120rpx;
				// overflow: hidden;
				position: relative;

				image {
					width: 100%;
					height: 100%;
				}

				view {
					position: absolute;
					bottom: 10rpx;
					left: 50%;
					width: 100%;
					text-align: center;
					transform: translateX(-50%);
					font-size: 28rpx;
					color: #404040;
				}
			}
		}

}
.textarea_item {
  padding: 20rpx;
  border: 1rpx solid #ddd;
  margin-bottom: 20rpx;
}
</style>
